#ifndef FTPSERVERPANEL_H
#define FTPSERVERPANEL_H

#include <QWidget>
#include <QFile>
#include <QMap>
#include <QTcpSocket>
#include <QFileSystemModel>
#include <QDateTime>
#include <QModelIndex>
#include "server.h"


namespace Ui {
class FTPServerPanel;
}

class FTPServerPanel : public QWidget
{
    Q_OBJECT

public:
    explicit FTPServerPanel(QWidget *parent = 0);
    ~FTPServerPanel();


signals:
    void deleteUser(int);

private slots:
    void appendLogServer(QString);
    void appendLogClient(QString, QString);
    void appendTable(QString, QString, QString);
    void removeFromTable(int);

    void deleteUserMenu(const QPoint &);


    void on_btn_UP_clicked();
    void on_btn_DN_clicked();
    void on_saveButton_clicked();
    void on_addUserButton_clicked();

    void SaveFtpConfig();
    void LoadFtpConfig();

    void on_browseButton_clicked();
    void getUsers();

    void on_userTable_doubleClicked(const QModelIndex &index);

    void on_btn_startServer_clicked();

    void on_btn_stopServer_clicked();

     void setStandardSettings();

private:
    Ui::FTPServerPanel *ui;
    void add(QString &username, QString &password);
    void load();
    QFileSystemModel *fileModel;
    QMap <QString, QString> users;
    Server *server;
    QString log(QString message);
};

#endif // FTPSERVERPANEL_H
